package com.cy.pj.eiems.controller;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.cy.pj.eiems.entity.SysStudent;
import com.cy.pj.eiems.service.SysStudentService;
import com.cy.pj.eiems.vo.JsonResult;



@RestController
@RequestMapping("/student/")
public class SysStudentController {
   @Autowired
   private SysStudentService sysStudentService;
   @RequestMapping("doFindObjects")
   public JsonResult doFindObjects() {
	   List<Map<String, Object>> findObjects = sysStudentService.findObjects();
	   System.out.println("------------------"+findObjects);
	   return new JsonResult(
			   findObjects);
   }
   @RequestMapping("doDeleteStudentObject")
   public JsonResult doDeleteStudentObject(Integer id) {
	   sysStudentService.deleteStudentObject(id);
	   return new JsonResult("delete ok");
   }
   @RequestMapping("doSaveStudentObject")
   public JsonResult doSaveStudentObject(SysStudent entity) {
	   sysStudentService.saveStudentObject(entity);
	   return new JsonResult("save ok");
   }
   @RequestMapping("doUpdateStudentObject")
   public JsonResult doUpdateStudentObject(SysStudent entity) {
	   sysStudentService.updateStudentObject(entity);
	   return new JsonResult("update ok");
   }
   @RequestMapping("doValidById")
   public JsonResult doValidById(
   			Integer id,
   			Integer valid){
   		        sysStudentService.validById(
   				id,valid);//"admin"用户将来是登陆用户
   		return new JsonResult("valid ok");
   }

}
